Skip to content

Conversation

@AlirezaShamsoshoara
Copy link
Member

Add Doom Environment with ViZDoom Integration

⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⢾⠍⡉⠉⠙⣿⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣴⠾⠿⠽⢷⣶⣤⡀⠀⠀⠀⠀⠀⠀⠀⢀⣟⡟⣠⣿⣶⡀⣷⡻⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⠴⡟⡋⡀⠀⣀⣀⠀⠀⠉⠛⣦⡀⠀⠀⠀⠀⠀⠀⢿⣅⣽⣿⣿⣷⣿⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡴⠃⢀⢾⣿⣿⣿⣯⣬⣽⣿⣀⡀⠈⠙⣆⠀⠀⠀⠀⢀⣸⣯⣿⣾⡷⢻⣿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣜⢁⠁⣾⡿⣙⠿⣯⣭⣍⣹⠼⠋⠁⣴⠀⢘⣧⠀⠀⡴⢛⣭⢟⠽⠋⢠⣼⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⢻⠘⢸⡿⢷⣬⣧⡀⠀⠀⠀⢀⣤⠾⢿⡇⠘⣿⡆⣸⠛⣿⡿⣟⡀⠀⡾⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣾⣦⣿⣿⡄⠈⢿⢿⣷⣶⡾⠋⠁⠀⣸⠇⡰⠛⢷⣷⣻⡿⠺⣿⣿⠽⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣀⣀⣀⣀⠀⣴⠏⠀⣿⠙⢻⣿⣄⠈⠀⠸⠀⠉⠀⣠⣾⠟⢀⣧⡇⠀⢽⣿⣿⣬⣼⣿⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⠚⣿⣿⣿⣿⣿⡿⠟⢛⣰⣿⣧⣷⣝⡿⣷⣞⢷⣄⣲⣾⣿⡃⢰⡿⡟⢀⣴⣿⣿⣿⣯⡿⠿⣿⣶⣤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⠞⢁⣼⣿⣿⣿⡟⠋⠁⣉⣽⣿⣿⣿⣿⣿⣽⣯⣿⡄⠉⠁⢷⣬⣹⣿⣿⣤⡾⠁⣸⣿⣿⡟⠁⠀⠀⢹⣿⣿⣷⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⡷⠞⣫⣾⣿⣿⣿⣧⡀⣤⠀⠈⣻⣿⣿⣿⣿⣿⣿⣿⣷⣖⠀⠘⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃⠋⠻⢤⣅⡺⢦⡀⠳⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⣰⣿⣯⣴⠞⠁⣀⣿⣿⣿⣿⣷⣄⣤⠤⢊⣿⣿⣿⣿⣿⣿⣿⣿⣯⣴⣴⣶⣿⣿⠟⣸⣿⣿⣿⣿⡏⡆⠀⢠⣤⣠⣥⠀⡟⣶⣿⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⣽⡿⣿⣏⡀⠀⠹⣟⣿⡿⣿⣿⣋⣶⣺⡽⣿⣏⣅⠛⠂⠴⠶⠿⠿⠃⠈⠉⠻⣷⣶⣿⣿⣿⣿⡿⠀⣿⡄⠈⣷⣮⠙⢀⡿⠘⢻⣇⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⢸⣧⢻⡶⠀⠀⠘⢿⣿⣿⣿⣿⣿⠋⠉⠀⠀⠉⠻⠿⠶⠶⠶⠦⠴⠞⠛⠷⠗⠈⠛⢿⣿⣿⡿⢁⣼⠯⠄⠀⠀⠀⣠⡞⠁⣠⣾⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⢸⣻⣾⣷⡀⢐⠀⣿⣿⣿⣿⣿⠁⠀⠠⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡁⠰⣾⣿⠀⠀⠈⢻⣿⣅⢿⣇⠀⠀⠀⠀⢀⣿⡟⠀⡷⢿⢿⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⣿⡎⣤⣌⡰⣿⣿⣿⣿⣟⠀⠠⠀⢀⡀⠀⠂⠀⠀⠉⠉⠉⠈⠉⠙⢾⣭⡤⠂⠀⠀⠹⣿⣎⣿⣶⣒⣿⣷⣿⣯⣮⡵⣿⣾⣿⡀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢻⢿⠛⣿⠛⠛⢿⣿⣿⣃⢀⣀⣀⠀⣀⣤⣾⠓⠶⠖⠷⣤⣄⡀⠀⠀⠀⠀⠀⠀⢠⣿⣿⣾⣿⣿⣿⠍⣩⣉⣿⡆⠰⣿⣭⡇⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡸⠾⢴⡇⠀⠀⢸⣿⣿⣯⣭⣿⣿⣿⡿⠛⠛⠛⠛⠛⠛⠛⠟⠻⣷⣶⣴⣶⣮⡴⠫⢾⣿⣿⣟⠉⣹⣿⣿⣿⣿⣷⣄⠸⢿⡇⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⣴⠋⡽⠁⡾⠀⠀⠀⣼⣿⣧⣁⣴⣶⠾⢿⣿⡶⠀⠒⠒⠂⠀⠀⠀⣰⣾⣧⣌⣉⠙⠂⢠⢿⣿⣿⣫⡿⠿⠋⠉⠈⠙⢻⣽⢧⠀⣽⣄⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⢀⣴⡻⣻⣼⣿⣰⠇⠀⠀⠀⠉⣁⣿⣟⢉⣼⣶⣶⡿⠿⣿⡟⠛⠛⠛⣷⣾⢿⣯⣤⣤⡉⠳⡶⢋⡞⣿⣿⣇⠀⠀⠙⠀⠀⠀⢀⣿⣫⠇⣈⣁⣣⡀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⣠⠎⠉⣰⣿⣿⣿⠉⢲⣤⠀⠀⠾⣿⣿⣳⣜⢿⡟⠫⢠⣶⣾⣷⣤⣤⣼⣯⡤⣤⣀⣻⠻⣿⣦⣠⠞⣼⣿⡿⢿⣤⡸⣷⣦⣤⣴⣿⣿⣯⠼⢥⣈⣿⡗⠶⢤⡀⠀⠀
⠀⠀⠀⠀⢰⡃⠀⣼⣿⣿⣿⣿⣷⣤⣁⣀⣤⣾⣿⣿⣿⣿⣿⣿⠷⣾⣟⣀⣫⣄⣀⣀⣠⣄⠘⢿⡤⠴⣷⡿⠃⠘⡽⣿⣃⠘⣿⣿⣿⣿⣿⣿⣿⠿⡿⠟⠀⠘⣝⢿⡆⠀⠻⣦⡀
⠀⠀⠀⢀⡏⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⢳⣿⣯⣿⣿⣿⡿⣾⣿⡏⠙⣿⡉⠙⡍⠉⢿⣟⣴⠶⠾⢿⣟⠷⣿⡿⠿⣷⣾⡇⢻⣿⣿⡏⡴⠞⠻⣞⡍⠙⢫⣿⣧⠀⠀⠘⠃
⠀⠀⢀⣾⢿⡾⢷⣿⣿⠋⣿⣿⣿⣿⣿⣿⣿⡗⣼⢿⣿⣿⠘⣿⣿⣷⣼⣣⣶⠾⠿⠛⠶⣦⠚⣠⣴⣿⣿⠋⢰⣼⣯⠁⠐⢺⣿⣿⣮⣿⣿⣿⡟⠂⢀⣽⡓⡀⠒⢹⣿⠇⠀⣤⡀
⠀⠀⣿⠿⣾⣳⣼⣏⠛⠛⢿⣯⣶⣿⢋⣼⣿⢱⣟⣷⣮⠻⣷⠘⠿⣿⣭⣉⡉⣠⣤⣤⣄⣉⣉⣁⣾⡿⠟⣠⣾⡏⣡⠎⠀⢸⣿⡌⣿⣿⣿⣿⣟⡂⠠⢿⡅⢨⡏⣾⣟⠀⠀⠈⠁
⠀⢸⡿⠓⢀⣿⣿⣿⡷⣦⣼⠟⣹⡵⠛⢳⢟⣾⣿⣿⡿⠀⣿⠄⡀⣿⣯⠙⣿⡟⠛⢛⠛⣿⣿⡏⢉⡇⠀⢯⣿⡇⡅⢴⠀⢸⣾⡇⠸⣟⠹⣿⢿⡏⢰⣿⣆⣈⠁⣽⣿⠀⠀⠀⠀
⢀⡖⠘⠃⢠⣿⣯⡟⠻⣿⣻⡟⠃⠀⠀⠸⣿⢿⣿⣿⣿⣾⣿⣿⣿⣿⣿⣧⢸⣧⣤⣭⣤⣿⣿⡔⢿⣿⡿⣿⣿⣿⣷⣤⣠⣿⣿⠃⠀⣿⣇⣿⣿⣷⣿⣿⠿⢽⣷⣩⣿⠀⠀⠀⠀
⣾⠁⣠⠹⣿⣿⡟⠻⣶⣿⢻⡇⠀⠀⠀⠀⠈⢹⡿⣿⣿⣿⣿⢟⣟⢿⢿⣿⣿⡷⠶⠶⠶⠈⢯⡻⡄⢻⣿⢀⠙⢿⣿⣿⣷⡟⠁⢀⣴⢟⣺⣿⣿⣿⣥⣽⣶⣄⣈⣿⣿⠀⠀⠀⠀
⣭⠎⠿⢠⡟⢿⣿⣷⣽⣿⣼⡇⠀⠀⠀⠀⢠⣿⢿⡛⢿⡿⣿⡾⣿⡇⢠⣿⣿⡇⠀⠀⠀⠀⣈⢻⡖⢸⣿⢿⣾⢏⠟⠛⢿⣧⣀⣸⣴⡿⢻⣿⣻⣍⠉⣉⠛⣛⠛⠛⢿⡷⠀⠀⢀
⢳⣶⠖⠈⢿⣿⣛⠹⣿⣿⢸⡃⠀⠀⠀⣠⠟⣩⠞⠀⠈⣿⡟⣵⡿⠃⣼⣿⣿⠁⠐⠀⠘⠃⠉⣸⣇⠀⠹⣦⢻⣟⠀⠀⠀⠹⣿⣴⣯⣼⣿⣿⣿⣿⡄⣿⡀⢿⣰⡇⢸⡇⠀⠠⠋
⠸⣹⡶⠀⢸⣿⣿⣿⣷⣛⢻⡇⠀⠀⢠⡷⠃⠁⠀⠀⠀⣿⠸⣿⠀⠠⣿⣿⣧⡀⠀⠀⠀⠀⢰⣿⣄⠁⠀⣹⢦⣿⣦⠀⠀⠀⣿⣿⣿⡏⣿⡏⡛⠟⢲⣶⢶⣾⣷⡭⣸⡴⠊⠀⠀
⠀⢹⡄⣄⡘⣿⣿⣿⣿⠹⡿⠁⠀⠀⣿⠇⠀⠀⠀⠀⡶⠘⡇⣿⡃⠂⣻⣿⣿⣷⡄⠀⠀⠀⢸⣿⣝⡓⢰⣿⣾⡏⣿⣦⠀⠀⢹⣾⣿⡎⢰⣷⣓⠀⣼⣿⢸⣿⢹⡆⢿⠇⠀⠀⠀
⠀⠀⠙⠻⣿⣿⠧⠭⠭⠟⠁⠀⠀⣸⡽⢐⠀⠀⠀⢸⣇⣸⡷⣿⠃⠀⢿⣿⣿⣿⣿⣿⣷⣦⣿⣿⣯⡟⢺⣿⣿⣇⣸⡿⡇⠀⢀⡟⣿⡧⢸⣷⡌⢀⣿⣿⣼⣿⠮⣿⠋⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠈⠁⠀⠀⠀⠀⠀⢀⣟⣷⡿⠀⠀⠀⠀⠉⢸⡇⡷⠀⢀⠈⠻⣿⣿⢿⣿⢿⣿⣿⣿⣿⣷⣾⣿⣿⡇⠉⠀⠀⠀⢸⡇⢸⣿⡾⡿⣧⣼⣿⠵⣿⣇⡾⠁⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣾⣼⡛⢸⡄⠀⠀⠀⢸⣧⢳⣀⠀⠀⠀⣿⢋⡟⠈⢧⢻⣿⣿⣿⣿⣿⣿⣿⣷⡀⠀⠀⠀⠈⡇⠀⢯⡇⠀⠉⠙⠙⠉⠉⠋⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⢹⡸⣷⠀⠀⠀⠄⠻⢷⣄⣀⢀⣼⣣⠟⠀⠀⠈⢣⠹⣿⣿⣿⣿⣿⣿⠿⢷⡄⠀⠀⠀⠀⠀⢸⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⡈⢁⣽⣷⡆⠀⠀⠀⠀⢈⣽⣿⡿⠃⠀⠀⠀⠀⠀⠙⣌⢻⣿⣿⣿⣿⠀⠈⢿⣦⠓⠀⠀⠀⣸⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⠚⢿⣷⣿⣿⣯⣻⡄⠀⠀⢀⣾⠟⡿⠁⠀⠀⠀⠀⠀⠀⠀⠈⢦⡻⣿⣿⣷⡀⢠⣾⣫⡿⣬⡃⠆⠛⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣻⣷⢾⣟⠛⠁⠉⢻⣿⣆⣠⡾⢿⣿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⣇⣸⣿⣿⣾⣾⣿⠇⠀⠈⢙⡟⠿⢻⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣫⡾⠿⣦⣀⣀⣠⡿⢿⣏⡴⣿⡏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣤⣤⣤⡞⠁⢂⣹⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⣉⣿⡳⠀⠀⠈⠁⠀⠀⠈⢿⡄⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⣿⢿⣿⣿⣿⣷⣄⠀⠀⠀⢀⡀⠘⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣰⣷⣻⣿⡟⠶⠶⠤⠤⠀⠀⠀⣸⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⣿⣿⣿⣿⣿⣿⣶⣖⣾⠭⡁⠈⢿⣳⣦⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⢰⣟⣿⣽⠋⣿⠃⢤⣭⣭⠀⠀⠀⣠⣟⣿⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⡿⣿⣿⣿⣿⣯⡥⠶⠀⣛⠀⢶⡿⡬⣷⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⣶⡿⢱⣿⣰⡿⠿⠶⢭⣦⠀⠀⣰⡿⢁⢿⣾⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢰⣿⣢⣿⣿⣿⣿⣷⣶⠖⠛⠙⢷⣌⡉⠹⣷⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⢰⣿⣗⣿⣿⣿⡀⣶⣶⠀⣹⣷⣾⣿⣷⡼⣯⣿⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⢿⣿⣿⣿⣿⣿⣿⣿⣗⣼⠄⠀⣿⣷⣀⣿⢷⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠈⢹⣿⡿⢻⣿⣷⣽⣏⣰⣿⣿⣿⣷⣶⣧⢹⣷⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⣭⠿⣿⣿⣿⣿⣿⣿⣿⣿⣥⣤⣾⠏⠻⡇⣿⡏⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⢿⣿⣿⣟⠻⠿⠿⠛⠹⣿⣿⣿⣿⣾⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⡇⣻⣿⣿⣿⣿⣿⡍⠛⠛⠋⠁⠀⣀⢿⣿⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⢸⡿⣿⣿⣿⣿⡗⠓⣤⠀⢀⣤⣿⢃⣸⠟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⢿⠻⣿⣿⣿⣿⣿⣏⣹⣧⢀⣾⡉⢸⣿⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⣼⡿⣿⣿⣿⣛⠁⠘⡋⠙⣋⣥⣿⢾⡏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢣⡜⣿⣿⣿⣿⡏⠛⢩⡉⠀⡛⢸⣿⢷⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⢀⣿⣷⣿⣿⣿⣯⣤⡤⡒⣛⣭⣭⢾⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⣿⢹⣿⣿⣿⣿⡦⠼⣷⠚⣩⠏⠹⣯⡀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⣿⡅⢠⣿⣿⣿⣧⣤⠾⠟⢛⣫⡵⣿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣳⢿⣿⣿⣿⣿⡶⣿⡞⠋⠀⠀⢻⣧⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⢰⣿⢡⢿⣿⣿⣿⣀⡀⠚⣠⣼⠁⢀⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣇⣼⣿⣿⣿⣿⣇⣼⣷⣶⣿⠟⠀⣿⣇⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⣞⠇⣶⣷⣬⣭⣉⣛⢛⣛⠉⣩⡷⢾⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡯⢽⣿⣿⣿⣿⣟⣉⣩⣤⡤⠶⠂⠸⣾⡄⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⣾⣿⡷⣿⣽⣾⣟⣿⣭⠈⠁⠀⣿⣠⣼⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣷⢦⣿⣿⣿⣿⣿⣯⣁⣾⣷⣶⣿⠣⣷⣵⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⢀⣾⢻⠤⠟⠓⠚⠻⢧⣀⠀⠀⠀⠙⣿⣿⣯⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⢻⣿⣿⢡⠿⠛⠋⠉⠩⠀⠀⠀⠒⠄⠞⣦⠀⠀⠀⠀⠀
⠀⠀⠀⠀⢸⣷⣴⢞⣏⣀⠀⡀⠀⣹⣦⠾⠟⢂⡍⠻⣷⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢨⠿⢛⣿⡶⢷⣤⣄⣀⣀⡀⢠⣴⣀⠠⡼⣿⡁⠀⠀⠀⠀
⠀⠀⠀⠀⢘⡃⢰⠀⡀⠀⠀⢀⡀⠀⠀⠈⠀⠀⢩⠈⣽⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣼⣿⣿⡀⣀⠒⣿⣿⠇⠀⠀⠀⠀⡀⡇⠘⣿⡀⠀⠀⠀
⠀⠀⠀⠀⠀⡇⢸⠈⠁⠀⠀⢸⡇⠀⡇⠀⢖⣔⣾⣾⡋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠑⣟⢿⣀⣿⣾⢿⣿⡇⠈⠁⠀⠀⠀⣿⣤⣧⠇⠀⠀⠀

Summary

This PR introduces a new Doom environment for OpenEnv, wrapping the ViZDoom platform to provide visual reinforcement learning capabilities for Doom-based scenarios. The environment supports multiple scenarios, configurable resolutions, discrete/continuous action spaces, and includes comprehensive documentation with visual examples.

doom_slayer_at_openEnv_school

Overview

The Doom environment (doom_env) integrates ViZDoom - a Doom-based AI research platform - into the OpenEnv framework, enabling agents to:

  • Learn from visual observations (RGB or grayscale screen buffers)
  • Execute actions in 3D game environments
  • Train on multiple built-in scenarios (basic, deadly_corridor, defend_the_center, etc.)
  • Track game variables (health, ammo, kills)
  • Deploy via Docker or run locally

What's Included

Core Implementation

  • models.py - Data models for actions and observations

    • DoomAction: Action dataclass with support for discrete actions or button combinations
    • DoomObservation: Observation dataclass with screen buffer, game variables, rewards, metadata
  • client.py - HTTP client for connecting to Doom servers

    • DoomEnv: Full-featured client with rendering support (OpenCV/matplotlib)
    • Automatic numpy type conversion for JSON serialization
    • Client-side rendering with render() method
  • server/doom_env_environment.py - Core ViZDoom wrapper

    • Configurable scenarios, resolutions, screen formats
    • Discrete actions and button combinations support
    • Episode management and state tracking
  • server/app.py - FastAPI server application

    • Environment variable configuration (scenario, resolution, format)
    • Web interface integration
    • Health check endpoint

Docker Support

  • server/Dockerfile - Standalone Docker image
    • Based on python:3.11-slim
    • Includes all ViZDoom system dependencies
    • Configurable via environment variables
    • Works for both local builds and HuggingFace deployment
    • Build command: docker build -t doom-env:latest -f src/envs/doom_env/server/Dockerfile src/envs/doom_env

Documentation

  • README.md - Comprehensive environment documentation

    • Quick start guides
    • Scenario gallery with descriptions
    • API reference
    • Configuration options
    • Deployment instructions
    • Visual examples with ASCII art Doom Slayer
  • GIF_GENERATION.md - Guide for generating scenario GIFs

    • Step-by-step instructions
    • Example commands
    • Troubleshooting tips
  • TEST_PLAN.md - Comprehensive test strategy (future implementation)

    • 67 planned test cases
    • Test categories and fixtures
    • Success criteria

Utilities

  • generate_gifs.py - Script to generate scenario visualization GIFs

    • Supports all ViZDoom scenarios
    • Configurable steps, resolution, FPS
    • Automatic output to assets/ directory
  • example.py - Example usage script (in examples directory)

    • Demonstrates basic usage
    • Docker and local modes
    • Rendering examples
  • doom_visualizer.py - Real-time game visualizer (in examples directory)

    • OpenCV-based visualization with keyboard controls
    • Matplotlib fallback
    • Auto-scaling for different resolutions
    • Interactive controls (arrows, space to shoot)

Assets

  • assets/doom_slayer_at_openEnv_school.png - Custom Doom Slayer artwork
  • assets/README.md - Assets directory documentation

Key Features

1. Multiple Scenarios

  • Basic - Simple target shooting (beginner-friendly)
  • Deadly Corridor - Navigate corridor while avoiding fireballs
  • Defend the Center - Survival mode defending against monsters
  • Defend the Line - Protect a line from advancing enemies
  • Health Gathering - Navigate maze collecting health packs
  • My Way Home - Navigation to goal location
  • Predict Position - Predict enemy positions
  • Take Cover - Strategic cover-based combat

2. Flexible Configuration

Environment Variables:

DOOM_SCENARIO=basic                 # Scenario selection
DOOM_SCREEN_RESOLUTION=RES_640X480  # Resolution (160x120 to 1024x768)
DOOM_SCREEN_FORMAT=RGB24            # RGB24 or GRAY8
DOOM_WINDOW_VISIBLE=false           # Show game window
ENABLE_WEB_INTERFACE=true           # Enable /web UI

3. Action Spaces

  • Discrete Actions: Simple integer action IDs (0-3 for basic scenario)
  • Button Combinations: Full control with custom button lists

4. Rendering Options

  • Web Interface - Browser-based UI at /web endpoint
  • Client-side Rendering - OpenCV or matplotlib visualization
  • RGB Array Mode - Return numpy arrays for custom processing

5. Docker Deployment

Local Build:

docker build -t doom-env:latest -f src/envs/doom_env/server/Dockerfile src/envs/doom_env
docker run -p 8000:8000 -e DOOM_SCREEN_RESOLUTION=RES_640X480 doom-env:latest

HuggingFace Deployment:

cd src/envs/doom_env
openenv push

Technical Details

Architecture

  • Client-Server Model: HTTP-based communication via OpenEnv framework
  • ViZDoom Integration: Native Python bindings to Doom engine
  • Screen Buffer Format: Flattened RGB/grayscale arrays for efficient transmission
  • State Management: Episode tracking, step counting, game variables

Fixed Issues

  1. Docker Build for HuggingFace

    • Fixed build context to work with both local and HF deployments
    • Changed from copying src/core/ to installing openenv-core via pip
    • Updated paths: WORKDIR /app/env, COPY . ., pip install -e .
  2. Environment Variable Configuration

    • server/app.py now reads DOOM_* environment variables
    • Docker resolution changes take effect at runtime
    • Proper defaults for all configuration options
  3. JSON Serialization

    • Added numpy type conversion in client.py::_step_payload()
    • Handles np.int64, np.float32, numpy arrays
    • Filters out None values from payload
  4. Rendering Window Size

    • doom_visualizer.py auto-scales windows based on resolution
    • Uses cv2.resize() with INTER_NEAREST for pixel art preservation
    • Target window size: 1024px width with appropriate scaling
  5. OpenEnv Validation

    • Restructured server/app.py to follow snake_env pattern
    • Added main() function with proper if __name__ == "__main__" block
    • Passes openenv validate for multi-mode deployment

Dependencies

Python Packages (from pyproject.toml):

dependencies = [
    "openenv-core>=0.1.0",
    "fastapi>=0.115.0",
    "pydantic>=2.0.0",
    "uvicorn[standard]>=0.24.0",
    "requests>=2.31.0",
    "vizdoom>=1.2.0",
    "numpy>=1.19.0",
]

Optional:

  • opencv-python>=4.5.0 - For client-side rendering
  • matplotlib>=3.3.0 - Rendering fallback
  • imageio>=2.9.0 - For GIF generation

System Dependencies (for ViZDoom):

  • build-essential, cmake
  • libboost-all-dev
  • libsdl2-dev, libfreetype6-dev
  • OpenGL libraries (libgl1-mesa-dev, libglu1-mesa-dev)

File Structure

doom_env/
├── __init__.py                           # Module exports
├── models.py                             # DoomAction, DoomObservation
├── client.py                             # DoomEnv HTTP client
├── README.md                             # Main documentation
├── GIF_GENERATION.md                     # GIF generation guide
├── TEST_PLAN.md                          # Test strategy
├── openenv.yaml                          # OpenEnv manifest
├── pyproject.toml                        # Dependencies
├── uv.lock                               # Locked dependencies
├── generate_gifs.py                      # GIF generation script
├── assets/                               # Generated GIFs and images
│   ├── doom_slayer_at_openEnv_school.png
│   └── README.md
└── server/
    ├── __init__.py
    ├── doom_env_environment.py           # ViZDoom wrapper
    ├── app.py                            # FastAPI server
    └── Dockerfile                        # Docker image

examples/
├── doom_example.py                       # Basic usage example
└── doom_visualizer.py                    # Interactive visualizer

Usage Examples

Basic Usage

from doom_env import DoomEnv, DoomAction

# Connect to server
client = DoomEnv(base_url="http://localhost:8000")

# Reset environment
result = client.reset()
print(f"Initial health: {result.observation.game_variables[0]}")

# Take actions
for _ in range(100):
    action = DoomAction(action_id=1)  # Move left
    result = client.step(action)

    if result.observation.done:
        print(f"Episode finished! Total reward: {result.reward}")
        break

client.close()

Docker Mode

from doom_env import DoomEnv, DoomAction

# Start container automatically
client = DoomEnv.from_docker_image("doom-env:latest")

result = client.reset()
result = client.step(DoomAction(action_id=0))

client.close()

With Rendering

client = DoomEnv.from_docker_image("doom-env:latest")
result = client.reset()

for _ in range(100):
    result = client.step(DoomAction(action_id=1))
    client.render()  # Display the game

client.close()

Visual Examples

The environment includes a custom Doom Slayer ASCII art and supports generating GIFs of all scenarios:

python generate_gifs.py basic --steps 500 --resolution RES_640X480

Testing

Comprehensive test plan covering:

  • 15 Model Tests - Data validation, serialization
  • 18 Environment Tests - ViZDoom wrapper functionality
  • 20 Client Tests - HTTP client, rendering, serialization
  • 14 Integration Tests - End-to-end, Docker, performance

Note: Test implementation deferred to future PR

Documentation Updates

Validation

  • Passes openenv validate for multi-mode deployment
  • Docker builds successfully: docker build -t doom-env:latest -f src/envs/doom_env/server/Dockerfile src/envs/doom_env
  • Runs locally: python -m doom_env.server.app
  • Deploys to HuggingFace: openenv push works correctly
  • Al environment variables respected at runtime
  • Cient-server communication verified with example scripts

Related Issues

  • Implements visual RL environment support for OpenEnv
  • Adds multi-scenario support with 8 built-in Doom scenarios
  • Add examples for RL training in the example folder

Future Work

  • Implement comprehensive test suite
  • Add support for custom WAD files
  • Implement multi-agent scenarios
  • Add more advanced scenarios (deathmatch, CTF)

Links

Breaking Changes

None - This is a new environment addition.

Checklist

  • Code follows project style guidelines
  • Documentation is comprehensive and clear
  • Docker builds successfully (local and HuggingFace)
  • Environment validates with openenv validate
  • Example scripts provided and tested
  • README includes usage examples
  • Added to environments documentation
  • HuggingFace Space deployed and working

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 26, 2025
@AlirezaShamsoshoara
Copy link
Member Author

The HF Space for the pushed doom-env is available here:
https://huggingface.co/spaces/Crashbandicoote2/doom_env

@AlirezaShamsoshoara
Copy link
Member Author

Adding reviewers here @init27 @Darktex @HamidShojanazeri @jspisak

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a comprehensive Doom environment to OpenEnv by integrating ViZDoom, a Doom-based AI research platform for visual reinforcement learning. The implementation provides visual observations, multiple built-in scenarios, flexible action spaces (discrete/continuous), and comprehensive tooling for development and deployment.

Key Changes:

  • Complete ViZDoom wrapper with 8 built-in scenarios (basic, deadly_corridor, defend_the_center, etc.)
  • HTTP client-server architecture with FastAPI backend and Python client
  • Docker deployment support with configurable environment variables
  • Comprehensive test suite (65 tests across models, environment, client, and integration)
  • Visualization tools (web interface, OpenCV/matplotlib rendering)
  • Documentation with scenario gallery, deployment guides, and troubleshooting

Reviewed changes

Copilot reviewed 28 out of 39 changed files in this pull request and generated 18 comments.

Show a summary per file
File Description
src/envs/doom_env/models.py Data models for actions and observations with screen buffer support
src/envs/doom_env/client.py HTTP client with rendering capabilities and numpy type conversion
src/envs/doom_env/server/doom_env_environment.py Core ViZDoom wrapper implementing OpenEnv Environment interface
src/envs/doom_env/server/app.py FastAPI application with environment variable configuration
src/envs/doom_env/server/Dockerfile Standalone Docker image with ViZDoom system dependencies
src/envs/doom_env/pyproject.toml Package configuration with all required dependencies
src/envs/doom_env/tests/*.py Comprehensive test suite (4 test files, 65 total tests)
examples/doom_example.py Example demonstrating Docker and local usage modes
examples/doom_visualizer.py Interactive visualizer with keyboard controls (OpenCV)
src/envs/doom_env/generate_gifs.py Utility script for generating scenario documentation GIFs
src/envs/doom_env/README.md Extensive documentation (611 lines) with usage examples
docs/environments.md Updated environment catalog with Doom card
.github/workflows/docker-build.yml Added doom-env to CI/CD pipeline

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +65 to +66
game_variables: List[float] = None
available_actions: List[int] = None
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default values for fields with mutable types should use field(default_factory=...) instead of direct assignment. Using None as a default for List[float] and List[int] fields can lead to issues. These should be Optional[List[float]] or use field(default_factory=list).

Copilot uses AI. Check for mistakes.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

"""Doom Env Environment - A simple test environment for HTTP server."""
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description says "Doom Env Environment - A simple test environment for HTTP server" but this is actually a full-featured ViZDoom integration for visual RL research, not a simple test environment. Update the description to accurately reflect its purpose.

Suggested change
"""Doom Env Environment - A simple test environment for HTTP server."""
"""Doom Env Environment - A full-featured ViZDoom integration for visual reinforcement learning (RL) research."""

Copilot uses AI. Check for mistakes.
Comment on lines +197 to +200
# Random action for demonstration
# if result.observation.available_actions:
# action_id = int(np.random.choice(result.observation.available_actions))

Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment appears to contain commented-out code.

Suggested change
# Random action for demonstration
# if result.observation.available_actions:
# action_id = int(np.random.choice(result.observation.available_actions))

Copilot uses AI. Check for mistakes.
action_id = 0 # Default: no action

if key == ord("q") or key == 27: # Q or ESC
running = False
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable running is not used.

Suggested change
running = False

Copilot uses AI. Check for mistakes.

result = env.reset()
plt.ion()
fig = plt.figure(figsize=(10, 7))
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable fig is not used.

Suggested change
fig = plt.figure(figsize=(10, 7))
plt.figure(figsize=(10, 7))

Copilot uses AI. Check for mistakes.
import subprocess
import requests
import numpy as np
from pathlib import Path
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'Path' is not used.

Copilot uses AI. Check for mistakes.
"""

import pytest
import numpy as np
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'np' is not used.

Copilot uses AI. Check for mistakes.
Tests data model validation, serialization, and edge cases.
"""

import pytest
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'pytest' is not used.

Copilot uses AI. Check for mistakes.

plt.close("all")
except ImportError:
pass
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'except' clause does nothing but pass and there is no explanatory comment.

Suggested change
pass
# Neither cv2 nor matplotlib is available for cleanup.
print(
"Warning: Could not clean up render windows because neither cv2 nor matplotlib is available. "
"Install with: pip install opencv-python or pip install matplotlib"
)

Copilot uses AI. Check for mistakes.
import matplotlib.pyplot as plt

plt.close("all")
except ImportError:
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'except' clause does nothing but pass and there is no explanatory comment.

Suggested change
except ImportError:
except ImportError:
# If matplotlib is not installed, we cannot close its windows, but this is non-critical during cleanup.

Copilot uses AI. Check for mistakes.
@AlirezaShamsoshoara AlirezaShamsoshoara self-assigned this Dec 9, 2025
@AlirezaShamsoshoara AlirezaShamsoshoara added the enhancement New feature or request label Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants